<?php
/**
 * Hesperos library for Zend Framework
 *
 * This script is protected by copyright. It's use, copying, modification
 * and distribution without written consent of the author is prohibited.
 *
 * @category    Hesperos
 * @package     Controller
 * @subpackage  Plugin
 * @author      Krzysztof Kardasz <krzysztof.kardasz@gmail.com>
 * @copyright   Copyright (c) 2011 Krzysztof Kardasz
 * @license     http://www.gnu.org/licenses/lgpl-3.0.txt  GNU Lesser General Public
 * @version     1.0 $Id$
 * @link        http://code.google.com/p/hesperos/
 */

/**
 * Plugin, inicjacja internacjonalizacji
 *
 * @category    Hesperos
 * @package     Controller
 * @subpackage  Plugin
 * @author      Krzysztof Kardasz <krzysztof.kardasz@gmail.com>
 * @copyright   Copyright (c) 2011 Krzysztof Kardasz
 * @version     1.0 $Id$
 */
class Hesperos_Controller_Plugin_I18n extends Zend_Controller_Plugin_Abstract
{
    /**
     * Zapisanie treści strony do cache
     */
    public function dispatchLoopStartup (Zend_Controller_Request_Abstract $request)
    {
        Hesperos_Translate_Manager::getTranslate()->getAdapter()->setLocale(
            $request->getParam('language', Hesperos_Locale_Manager::getLocale())
        );
    }
}